<%@ taglib prefix="s" uri="/struts-tags" %>
<%--
  Created by IntelliJ IDEA.
  User: wzzz
  Date: 2017/7/11
  Time: 8:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <%--<link href="font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">--%>

</head>
<body >


<%--1 此处应从session获得用户信息和标签信息--%>
<%
    String user_name = (String)session.getAttribute("user_name");
    String[] tagList = (String[]) session.getAttribute("tagList");  //获取标签列表
//    String passwordChange = (String) session.getAttribute("passwordChange");
//    String tagChange = (String) session.getAttribute("tagChange");
%>


<div class="container">
    <div class="row col-md-8 col-md-offset-2" style="margin-top: 60px">
        <div class="row clearfix">
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-success" id="right-info-panel">
                        <div class="panel-heading panel-title">基本信息<a data-target="#alter-info" data-toggle="modal"><span class="pull-right">修改</span></a></div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-md-8">
                                    <table class="table">
                                        <tr>
                                            <%--2  显示姓名和密码--%>


                                            <th>用户名：<%= user_name%></th>
                                        </tr>
                                        <tr>
                                            <th>密&nbsp;&nbsp;&nbsp;&nbsp;码：**********</th>
                                        </tr>
                                        <%--<s:fielderror fieldName="passwordUpdateResult" ></s:fielderror>--%>
                                    </table>

                                    <div>${passwordChange}</div>
                                </div>
                                <div class="col-mn-2"><a href="testAction">退出登录</a></div>
                            </div>

                            <h4>我的标签：</h4>
                            <%--<s:fielderror fieldName="tagUpdateResult" ></s:fielderror>--%>
                            <input type="button" value="<%= tagList[0] %>" class="btn btn-primary">
                            <input type="button" value="<%= tagList[1] %>" class="btn btn-primary">
                            <input type="button" value="<%= tagList[2] %>" class="btn btn-primary">
                            <input type="button" value="<%= tagList[3] %>" class="btn btn-primary">
                            <input type="button" value="<%= tagList[4] %>" class="btn btn-primary">
                            <input type="button" value="<%= tagList[5] %>" class="btn btn-primary">
                                &nbsp<a href="reselectTagdAction">重新选择我的标签~</a>

                            <br>
                            <br>
                            <%--3  --%>

                            <div>
                                <a href="homeAction" class="pull-right">返回首页</a>
                            </div>
                            <div>
                                ${tagChange}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="alter-info" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4>修改个人信息</h4>
                </div>

            <div class="row">
                <div class="modal-body">
                    <div class=" col-md-6">
                        <div class="form-group">
                            <form action="updatePasswordAction" method="post">
                                <table width="100%">
                                <tr>

                                    <%--4  此处显示旧信息，form的action需要更改  --%>
                                    <td><label>用户名</label></td>
                                    <td><input type="text" name="user_name" value="<%=user_name%>" disabled="disabled"></td>
                                </tr>
                                <tr>
                                    <td><label>密&nbsp;&nbsp;&nbsp;&nbsp;码</label></td>
                                    <td><input type="text" name="user_password" value=""></td>
                                </tr>
                            </table>
                            </form>
                            <%--<s:fielderror fieldName="passwordUpdateResult" ></s:fielderror>--%>
                        </div>
                    </div>
                </div>
            </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="mysubmit()">修改</button><!--提交修改密码信息-->
                </div>

        </div>
    </div>
</div>
<script>
    function mysubmit() {
        document.forms[0].submit();
    }
</script>

</body>
</html>
